"use strict";
cc._RF.push(module, '5d256+0nqhFQqu8A44VZjKv', 'CarWeaponView');
// scripts/CarWeaponView.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("GameConstant"),
    s = t("GameLogic"),
    l = t("CarWeaponControl"),
    c = t("WeaponHammer"),
    d = t("WeaponRocket"),
    h = t("WeaponSaw"),
    p = t("ToolsTray"),
    u = t("CarConstant"),
    f = t("Util"),
    m = t("WeaponElecSaw"),
    _ = t("ToolsThruster"),
    y = t("ToolsRevThruster"),
    g = t("WeaponFist"),
    v = t("ToolsHarpoon"),
    C = t("CarEffectBlast"),
    b = t("CarEffectDizziness"),
    w = t("WeaponDoubleSaw"),
    S = t("WeaponGatlin"),
    I = t("WeaponGrape"),
    B = t("ToolsMine"),
    T = t("WeaponLaser"),
    A = t("WeaponShotgun"),
    G = t("WeaponBoom"),
    D = cc._decorator,
    O = D.ccclass,
    R = D.property,
    P = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.pfb_blast = null, e.pfb_dizziness = null, e.pfb_elecsaw = null, e.pfb_saw = null, e.pfb_hammer = null, e.pfb_rocket = null, e.pfb_fist = null, e.pfb_doubelSaw = null, e.pfb_gatlin = null, e.pfb_grenade = null, e.pfb_laser = null, e.pfb_shotgun = null, e.pfb_boom = null, e.pfb_tray = null, e.pfb_thruster = null, e.pfb_revThruster = null, e.pfb_harpoon = null, e.pfb_mine = null, e.node_carLeft = null, e.node_carRight = null, e.node_wheel0 = null, e.node_wheel1 = null, e._gameLogic = new s.GameLogic(), e._gameControl = null, e.elecSawControl = null, e.sawControl = null, e.hammerControl = null, e.rocketControl = null, e.fistControl = null, e.doubleSawControl = null, e.gatlinControl = null, e.grenadeControl = null, e.laserControl = null, e.shotgunControl = null, e.boomControl = null, e.trayControl = null, e.thrusterControl = null, e.revThrusterControl = null, e.harpoonControl = null, e.mineControl = null, e.node_car = null, e.curEquipBodyUid = 0, e._nCarSite = 0, e._equipBodyId = "", e.bAiStart = !1, e.nCurTime = 0, e.bCDToolsing = !1, e.bOverView = !1, e.effectBlast = null, e.effectDizziness = null, e;
  }

  return n(e, t), e.prototype.update = function () {
    this.trayControl && this.trayControl.setNodePostion();
  }, e.prototype.onGameStart = function () {}, e.prototype.onGameOver = function () {
    this.node_car.getComponent(l["default"]) && this.node_car.getComponent(l["default"]).onGameOver(), this.sawControl && this.sawControl.onGameOver(), this.elecSawControl && this.elecSawControl.onGameOver(), this.hammerControl && this.hammerControl.onGameOver(), this.rocketControl && this.rocketControl.onGameOver(), this.fistControl && this.fistControl.onGameOver(), this.doubleSawControl && this.doubleSawControl.onGameOver(), this.gatlinControl && this.gatlinControl.onGameOver(), this.grenadeControl && this.grenadeControl.onGameOver(), this.laserControl && this.laserControl.onGameOver(), this.shotgunControl && this.shotgunControl.onGameOver(), this.boomControl && this.boomControl.onGameOver(), this.trayControl && this.trayControl.onGameOver(), this.thrusterControl && this.thrusterControl.onGameOver(), this.revThrusterControl && this.revThrusterControl.onGameOver(), this.mineControl && this.mineControl.onGameOver(), this.node.destroy(), this.destroy();
  }, e.prototype.onGameWin = function () {}, e.prototype.onGameFail = function () {}, e.prototype.onGameBoutReady = function () {
    this.effectBlast && this.effectBlast.onGameBoutReady(), this.node_carLeft.active = !1, this.node_carRight.active = !1, this.node_car.active = !1, this.effectDizziness && (this.effectDizziness.node && this.effectDizziness.node.destroy(), this.effectDizziness = null), this.node_car.getComponent(l["default"]) && this.node_car.getComponent(l["default"]).onGameBoutReady(), this.sawControl && this.sawControl.onGameBoutReady(), this.elecSawControl && this.elecSawControl.onGameBoutReady(), this.hammerControl && this.hammerControl.onGameBoutReady(), this.rocketControl && this.rocketControl.onGameBoutReady(), this.fistControl && this.fistControl.onGameBoutReady(), this.doubleSawControl && this.doubleSawControl.onGameBoutReady(), this.gatlinControl && this.gatlinControl.onGameBoutReady(), this.grenadeControl && this.grenadeControl.onGameBoutReady(), this.laserControl && this.laserControl.onGameBoutReady(), this.laserControl && this.laserControl.onGameBoutReady(), this.trayControl && this.trayControl.onGameBoutReady(), this.thrusterControl && this.thrusterControl.onGameBoutReady(), this.revThrusterControl && this.revThrusterControl.onGameBoutOver(), this.harpoonControl && this.harpoonControl.onGameBoutOver(), this.mineControl && this.mineControl.onGameBoutOver(), this.node_car = null, this.curEquipBodyUid = 0, this._nCarSite = 0, this._equipBodyId = "", this.sawControl = null, this.elecSawControl = null, this.hammerControl = null, this.rocketControl = null, this.fistControl = null, this.doubleSawControl = null, this.gatlinControl = null, this.grenadeControl = null, this.laserControl = null, this.shotgunControl = null, this.boomControl = null, this.trayControl = null, this.thrusterControl = null, this.revThrusterControl = null, this.harpoonControl = null, this.mineControl = null, this.destroy();
  }, e.prototype.onGameBoutStart = function () {
    this.effectBlast && this.effectBlast.onGameBoutStart(), this.node_car.active = !0, this.node_car.getComponent(l["default"]) && this.node_car.getComponent(l["default"]).onGameBoutStart(), this.sawControl && this.sawControl.onGameBoutStart(), this.elecSawControl && this.elecSawControl.onGameBoutStart(), this.hammerControl && this.hammerControl.onGameBoutStart(), this.rocketControl && this.rocketControl.onGameBoutStart(), this.fistControl && this.fistControl.onGameBoutStart(), this.doubleSawControl && this.doubleSawControl.onGameBoutStart(), this.gatlinControl && this.gatlinControl.onGameBoutStart(), this.grenadeControl && this.grenadeControl.onGameBoutStart(), this.laserControl && this.laserControl.onGameBoutStart(), this.shotgunControl && this.shotgunControl.onGameBoutStart(), this.boomControl && this.boomControl.onGameBoutStart(), this.trayControl && this.trayControl.onGameBoutStart(), this.thrusterControl && this.thrusterControl.onGameBoutStart(), this.revThrusterControl && this.revThrusterControl.onGameBoutStart(), this.harpoonControl && this.harpoonControl.onGameBoutStart(), this.mineControl && this.mineControl.onGameBoutStart();
  }, e.prototype.onGameBoutOver = function () {
    this.node_car.getComponent(l["default"]) && this.node_car.getComponent(l["default"]).onGameBoutOver(), this.sawControl && this.sawControl.onGameBoutOver(), this.elecSawControl && this.elecSawControl.onGameBoutOver(), this.hammerControl && this.hammerControl.onGameBoutOver(), this.rocketControl && this.rocketControl.onGameBoutOver(), this.fistControl && this.fistControl.onGameBoutOver(), this.doubleSawControl && this.doubleSawControl.onGameBoutOver(), this.gatlinControl && this.gatlinControl.onGameBoutOver(), this.grenadeControl && this.grenadeControl.onGameBoutOver(), this.laserControl && this.laserControl.onGameBoutOver(), this.shotgunControl && this.shotgunControl.onGameBoutOver(), this.boomControl && this.boomControl.onGameBoutOver(), this.trayControl && this.trayControl.onGameBoutOver(), this.thrusterControl && this.thrusterControl.onGameBoutOver(), this.revThrusterControl && this.revThrusterControl.onGameBoutOver(), this.harpoonControl && this.harpoonControl.onGameBoutOver(), this.mineControl && this.mineControl.onGameBoutOver();
  }, e.prototype.onGameBoutWin = function () {}, e.prototype.onGameBoutFail = function () {
    this.playEffectBlast(this._nCarSite, this.getAngle()), this.node_car.active = !1;
  }, e.prototype.onTakeDamage = function (t) {
    this.node_car.getComponent(l["default"]) && this.node_car.getComponent(l["default"]).onCanAttack(t);
  }, e.prototype.onCanAttack = function (t) {
    this.playEffectDizziness(!t), this.sawControl && this.sawControl.onCanAttack(t), this.elecSawControl && this.elecSawControl.onCanAttack(t), this.hammerControl && this.hammerControl.onCanAttack(t), this.rocketControl && this.rocketControl.onCanAttack(t), this.fistControl && this.fistControl.onCanAttack(t), this.doubleSawControl && this.doubleSawControl.onCanAttack(t), this.gatlinControl && this.gatlinControl.onCanAttack(t), this.grenadeControl && this.grenadeControl.onCanAttack(t), this.laserControl && this.laserControl.onCanAttack(t), this.shotgunControl && this.shotgunControl.onCanAttack(t), this.boomControl && this.boomControl.onCanAttack(t), this.trayControl && this.trayControl.onCanAttack(t), this.thrusterControl && this.thrusterControl.onCanAttack(t), this.revThrusterControl && this.revThrusterControl.onCanAttack(t), this.harpoonControl && this.harpoonControl.onCanAttack(t), this.mineControl && this.mineControl.onCanAttack(t);
  }, e.prototype.onMoveLeft = function (t) {
    t && (this._nCarSite == r.Car_Site.Left ? this.node.scaleX = -Math.abs(this.node.scaleX) : this._nCarSite == r.Car_Site.Right && (this.node.scaleX = Math.abs(this.node.scaleX)), this.trayControl && this.trayControl.onMoveLeft(), this.fistControl && this.fistControl.onMoveLeft(), this.harpoonControl && this.harpoonControl.onMoveLeft());
  }, e.prototype.onMoveRight = function (t) {
    t && (this._nCarSite == r.Car_Site.Left ? this.node.scaleX = Math.abs(this.node.scaleX) : this._nCarSite == r.Car_Site.Right && (this.node.scaleX = -Math.abs(this.node.scaleX)), this.trayControl && this.trayControl.onMoveRight(), this.fistControl && this.fistControl.onMoveRight(), this.harpoonControl && this.harpoonControl.onMoveRight());
  }, e.prototype.onMoveCancel = function () {}, e.prototype.onAirShipIn = function () {
    this.node_car.getComponent(l["default"]).onAirShipIn(), this.node.active = !1;
  }, e.prototype.onAirShipOut = function (t) {
    this.node.position = t, this.node_car.getComponent(l["default"]).onAirShipOut(), this.node.active = !0;
  }, e.prototype.onUseTools = function (t) {
    this.trayControl && this.trayControl.onUseTools(t), this.thrusterControl && this.thrusterControl.onUseTools(t), this.revThrusterControl && this.revThrusterControl.onUseTools(t), this.harpoonControl && this.harpoonControl.onUseTools(t), this.mineControl && this.mineControl.onUseTools(t);
  }, e.prototype.onCancelUseTools = function (t) {
    this.trayControl && this.trayControl.onCancelUse(t), this.thrusterControl && this.thrusterControl.onCancelUse(t), this.revThrusterControl && this.revThrusterControl.onCancelUse(t), this.harpoonControl && this.harpoonControl.onCancelUse(t), this.mineControl && this.mineControl.onCancelUse(t);
  }, e.prototype.onUseWeapon = function () {}, e.prototype.onCancelUseWeapon = function () {}, e.prototype.onAIUseTools = function (t) {
    if (!this.bAiStart) return this.nCurTime += t, void (this.nCurTime > r.GameStart_Time_interval + f.Util.getRandomInt(20, 30) / 10 && (this.bAiStart = !0, this.nCurTime = 0));

    if (!this.bCDToolsing) {
      if (this.nCurTime < .5) return this.onUseTools(!0), void (this.nCurTime = 0);
      this.nCurTime < 1 && this.onCancelUseTools(!0), this.nCurTime += t;
    }
  }, e.prototype.setUseToolsState = function () {
    var t = this;
    this.bCDToolsing = !0, cc.tween(this.node).delay(r.UseTools_CD_Time).call(function () {
      t.bCDToolsing = !1;
    }).start();
  }, e.prototype.init = function (t, e, o, i, n, a, s) {
    switch (this._gameControl = t, this._nCarSite = e, this._equipBodyId = o, this.node.active = !0, this.curEquipBodyUid = s, e) {
      case r.Car_Site.Left:
        this.node_carLeft.active = !0, this.node_carRight.active = !1, this.node_car = this.node_carLeft, null != this._gameControl && this.node_car.getComponent(l["default"]).init(this._gameControl, r.Collide_Car_Tag.Left, i), this.createWeapon(n, r.Collide_Car_Tag.Left), this.createTools(a, r.Collide_Car_Tag.Left), this.initWheelPos(i, r.Collide_Car_Tag.Left);
        break;

      case r.Car_Site.Right:
        this.node_carLeft.active = !1, this.node_carRight.active = !0, this.node_car = this.node_carRight, null != this._gameControl && this.node_car.getComponent(l["default"]).init(this._gameControl, r.Collide_Car_Tag.Right, i), this.createWeapon(n, r.Collide_Car_Tag.Right), this.createTools(a, r.Collide_Car_Tag.Right), this.initWheelPos(i, r.Collide_Car_Tag.Right);
    }
  }, e.prototype.initOverView = function (t, e, o, i, n, a) {
    switch (this.bOverView = !0, this._nCarSite = t, this._equipBodyId = e, this.node.active = !0, this.curEquipBodyUid = a, t) {
      case r.Car_Site.Left:
        this.node_carLeft.active = !0, this.node_carRight.active = !1, this.node_car = this.node_carLeft, this.createWeapon(i, r.Collide_Car_Tag.Left), this.createTools(n, r.Collide_Car_Tag.Left);
        break;

      case r.Car_Site.Right:
        this.node_carLeft.active = !1, this.node_carRight.active = !0, this.node_car = this.node_carRight, this.createWeapon(i, r.Collide_Car_Tag.Right), this.createTools(n, r.Collide_Car_Tag.Right);
    }
  }, e.prototype.initWheelPos = function (t, e) {
    var o = u.GetCarBodyData(this._equipBodyId).wheelPos;

    if (e == r.Collide_Car_Tag.Left) {
      for (var i = 0; i < t.length; i++) {
        if (t[i]) {
          var n = f.Util.getWheelData(t[i]).id,
              a = u.GetCarWheelData(n).radius;
          this["node_wheel" + i].getComponent(cc.CircleCollider).radius = a, this["node_wheel" + i].position = o[i];
        }
      }
    } else for (i = 0; i < t.length; i++) {
      t[i] && (n = t[i].id, a = u.GetCarWheelData(n).radius, this["node_wheel" + i].getComponent(cc.CircleCollider).radius = a, this["node_wheel" + i].position = cc.v3(-o[i].x, o[i].y, o[i].z));
    }
  }, e.prototype.setPos = function (t) {
    this.node.position = t;
  }, e.prototype.setAngle = function (t) {
    this.node.angle = t;
  }, e.prototype.getAngle = function () {
    return this.node.angle;
  }, e.prototype.getBodyId = function () {
    return this._equipBodyId;
  }, e.prototype.playEffectBlast = function (t) {
    if (!this.effectBlast) {
      var e = cc.instantiate(this.pfb_blast);
      this.effectBlast = e.getComponent(C["default"]), this.effectBlast.init(this._gameControl);
    }

    this.effectBlast.playEffect(t);
  }, e.prototype.playEffectDizziness = function (t) {
    if (!this.effectDizziness) {
      var e = cc.instantiate(this.pfb_dizziness);
      this.node.addChild(e), this.effectDizziness = e.getComponent(b["default"]);
    }

    this.effectDizziness.playEffect(t);
  }, e.prototype.createWeapon = function (t, e) {
    if (t && t[0]) {
      var o = null;

      switch (e == r.Collide_Car_Tag.Left ? o = f.Util.getWeaponData(t[0]) : e == r.Collide_Car_Tag.Right && (o = t[0]), u.getWeaponData(o.id).index) {
        case 0:
          this.createRocket(this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Rocket), f.Util.transformDamageNum(o.damage, o.level), e);
          break;

        case 1:
          this.createSaw(e, this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Saw), f.Util.transformDamageNum(o.damage, o.level));
          break;

        case 2:
          this.createHammer(e, this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Hammer), f.Util.transformDamageNum(o.damage, o.level));
          break;

        case 3:
          this.createElecSaw(e, this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.ElecSaw), f.Util.transformDamageNum(o.damage, o.level));
          break;

        case 4:
          this.createFist(e, this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Fist), f.Util.transformDamageNum(o.damage, o.level));
          break;

        case 5:
          this.createDoubleSaw(e, this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.DoubleSaw), f.Util.transformDamageNum(o.damage, o.level));
          break;

        case 6:
          this.createGatlin(this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Gatlin), f.Util.transformDamageNum(o.damage, o.level), e);
          break;

        case 7:
          this.createGrenade(this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Grenade), f.Util.transformDamageNum(o.damage, o.level), e);
          break;

        case 8:
          this.createLaser(this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Laser), f.Util.transformDamageNum(o.damage, o.level), e);
          break;

        case 9:
          this.createShotgun(this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.shotgun), f.Util.transformDamageNum(o.damage, o.level), e);
          break;

        case 10:
          this.createBoom(this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.boomerang), f.Util.transformDamageNum(o.damage, o.level), e);
      }
    }
  }, e.prototype.createTools = function (t, e) {
    if (t && t[0]) {
      var o = null;

      switch (e == r.Collide_Car_Tag.Left ? o = f.Util.getToolsData(t[0]) : e == r.Collide_Car_Tag.Right && (o = t[0]), u.getToolsData(o.id).index) {
        case 0:
          this.createTray(e, this._gameLogic.getCollideTag(e, r.Collide_Weapon_Tag.Tray), o.damage);
          break;

        case 1:
          this.createRevThruster(e);
          break;

        case 2:
          this.createThruster(e);
          break;

        case 3:
          this.createHarPoon(e);
          break;

        case 4:
          this.createMiner(e);
      }
    }
  }, e.prototype.createElecSaw = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_elecsaw);
    this.node_car.addChild(n), this.elecSawControl = n.getComponent(m["default"]), this.elecSawControl.init(t, e, o, i.weaponPos[0]);
  }, e.prototype.createSaw = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_saw);
    this.node_car.addChild(n), this.sawControl = n.getComponent(h["default"]), this.sawControl.init(t, e, o, i.weaponPos[0]);
  }, e.prototype.createHammer = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_hammer);
    this.node_car.addChild(n), this.hammerControl = n.getComponent(c["default"]), this.hammerControl.init(t, e, o, i.weaponPos[0]);
  }, e.prototype.createDoubleSaw = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_doubelSaw);
    this.node_car.addChild(n), this.doubleSawControl = n.getComponent(w["default"]), this.doubleSawControl.init(t, e, o, i.weaponPos[0]);
  }, e.prototype.createRocket = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_rocket);
    this.node_car.addChild(n), this.rocketControl = n.getComponent(d["default"]), this.rocketControl.init(this._gameControl, this.node, t, e, o, i.weaponPos[0]);
  }, e.prototype.createGatlin = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_gatlin);
    this.node_car.addChild(n), this.gatlinControl = n.getComponent(S["default"]), this.gatlinControl.init(this._gameControl, this.node, t, e, o, i.weaponPos[0]);
  }, e.prototype.createGrenade = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_grenade);
    this.node_car.addChild(n), this.grenadeControl = n.getComponent(I["default"]), this.grenadeControl.init(this._gameControl, this.node, t, e, o, i.weaponPos[0]);
  }, e.prototype.createShotgun = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_shotgun);
    this.node_car.addChild(n), this.shotgunControl = n.getComponent(A["default"]), this.shotgunControl.init(this._gameControl, this.node, t, e, o, i.weaponPos[0]);
  }, e.prototype.createBoom = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_boom);
    this.node_car.addChild(n), this.boomControl = n.getComponent(G["default"]), this.boomControl.init(this._gameControl, this.node, t, e, o, i.weaponPos[0]);
  }, e.prototype.createLaser = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_laser);
    this.node_car.addChild(n), this.laserControl = n.getComponent(T["default"]), this.laserControl.init(this._gameControl, this.node, t, e, o, i.weaponPos[0]);
  }, e.prototype.createFist = function (t, e, o) {
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_fist);
    this.node_car.addChild(n), this.fistControl = n.getComponent(g["default"]), this.fistControl.init(t, e, o, i.weaponPos[0]);
  }, e.prototype.createTray = function (t, e) {
    var o = null;
    t == r.Collide_Car_Tag.Left ? o = this._gameControl._carLeftView.getRigidBody() : t == r.Collide_Car_Tag.Right && (o = this._gameControl._carRightView.getRigidBody());
    var i = u.GetCarBodyData(this._equipBodyId),
        n = cc.instantiate(this.pfb_tray);
    this.node_car.addChild(n), this.trayControl = n.getComponent(p["default"]), this.trayControl.init(t, e, i.toolsPos[0], o);
  }, e.prototype.createThruster = function (t) {
    var e = u.GetCarBodyData(this._equipBodyId),
        o = cc.instantiate(this.pfb_thruster);
    this.node_car.addChild(o), this.thrusterControl = o.getComponent(_["default"]), this.thrusterControl.init(this._gameControl, this._nCarSite, t, e.toolsPos[0]);
  }, e.prototype.createRevThruster = function (t) {
    var e = u.GetCarBodyData(this._equipBodyId),
        o = cc.instantiate(this.pfb_revThruster);
    this.node_car.addChild(o), this.revThrusterControl = o.getComponent(y["default"]), this.revThrusterControl.init(this._gameControl, this._nCarSite, t, e.toolsPos[0]);
  }, e.prototype.createHarPoon = function (t) {
    var e = u.GetCarBodyData(this._equipBodyId),
        o = cc.instantiate(this.pfb_harpoon);
    this.node_car.addChild(o);
    var i = null;
    this.bOverView ? i = null : t == r.Collide_Car_Tag.Left ? i = this._gameControl._carLeftView.getRigidBody() : t == r.Collide_Car_Tag.Right && (i = this._gameControl._carRightView.getRigidBody());

    var n = this._gameLogic.getCollideTag(t, r.Collide_Weapon_Tag.Harpoon);

    this.harpoonControl = o.getComponent(v["default"]), this.harpoonControl.init(this._gameControl, this._nCarSite, t, n, e.toolsPos[0], i);
  }, e.prototype.createMiner = function (t) {
    u.GetCarBodyData(this._equipBodyId);
    var e = cc.instantiate(this.pfb_mine);
    this.node_car.addChild(e), this.bOverView || (t == r.Collide_Car_Tag.Left ? this._gameControl._carLeftView.getRigidBody() : t == r.Collide_Car_Tag.Right && this._gameControl._carRightView.getRigidBody()), this._gameLogic.getCollideTag(t, r.Collide_Weapon_Tag.Mine), this.mineControl = e.getComponent(B["default"]), this.mineControl.init(this._gameControl, this._nCarSite, t, cc.Vec3.ZERO);
  }, e.prototype.getDamage = function (t) {
    switch (t) {
      case r.Collide_Weapon_Tag.Hammer:
        return this.hammerControl && this.hammerControl.getDamage();

      case r.Collide_Weapon_Tag.Saw:
        return this.sawControl && this.sawControl.playEffect(), this.sawControl && this.sawControl.getDamage();

      case r.Collide_Weapon_Tag.Rocket:
        return this.rocketControl && this.rocketControl.getDamage();

      case r.Collide_Weapon_Tag.ElecSaw:
        if (this.elecSawControl) {
          var e = this.elecSawControl.getDamage(),
              o = this.elecSawControl.isDisassembly();
          return o && this._gameControl.onDisassembly(this._nCarSite, o), e;
        }

        break;

      case r.Collide_Weapon_Tag.Fist:
        return this.fistControl && this.fistControl.getDamage();

      case r.Collide_Weapon_Tag.DoubleSaw:
        return this.doubleSawControl && this.doubleSawControl.getDamage();

      case r.Collide_Weapon_Tag.Gatlin:
        return this.gatlinControl && this.gatlinControl.getDamage();

      case r.Collide_Weapon_Tag.Grenade:
        return this.grenadeControl && this.grenadeControl.getDamage();

      case r.Collide_Weapon_Tag.Laser:
        return this.laserControl && this.laserControl.getDamage();

      case r.Collide_Weapon_Tag.shotgun:
        return this.shotgunControl && this.shotgunControl.getDamage();

      case r.Collide_Weapon_Tag.boomerang:
        return this.boomControl && this.boomControl.getDamage();
    }

    return 0;
  }, e.prototype.weaponLeaveCar = function (t) {
    switch (t) {
      case r.Collide_Weapon_Tag.Hammer:
        break;

      case r.Collide_Weapon_Tag.Saw:
        this.sawControl.leaveOtherCar();
        break;

      case r.Collide_Weapon_Tag.Rocket:
    }

    return 0;
  }, e.prototype.onDisassembly = function (t) {
    1 == t && (this.onDisassemblyTray(), this.thrusterControl && this.thrusterControl.onDisassembly(), this.revThrusterControl && this.revThrusterControl.onDisassembly(), this.harpoonControl && this.harpoonControl.onDisassembly());
  }, e.prototype.onPlayHarpoon = function (t) {
    this.harpoonControl && this.harpoonControl.onPlayHarpoon(t);
  }, e.prototype.onDisassemblyTray = function () {
    if (this.trayControl) {
      var t = this.trayControl.getPos(),
          e = this.node_car.convertToNodeSpaceAR(t);
      this.trayControl.onDisassembly();
      var o = cc.instantiate(this.pfb_tray);
      this.node_car.addChild(o), this.trayControl = o.getComponent(p["default"]), this.trayControl.init(0, 0, e, null);
    }
  }, a([R(cc.Prefab)], e.prototype, "pfb_blast", void 0), a([R(cc.Prefab)], e.prototype, "pfb_dizziness", void 0), a([R(cc.Prefab)], e.prototype, "pfb_elecsaw", void 0), a([R(cc.Prefab)], e.prototype, "pfb_saw", void 0), a([R(cc.Prefab)], e.prototype, "pfb_hammer", void 0), a([R(cc.Prefab)], e.prototype, "pfb_rocket", void 0), a([R(cc.Prefab)], e.prototype, "pfb_fist", void 0), a([R(cc.Prefab)], e.prototype, "pfb_doubelSaw", void 0), a([R(cc.Prefab)], e.prototype, "pfb_gatlin", void 0), a([R(cc.Prefab)], e.prototype, "pfb_grenade", void 0), a([R(cc.Prefab)], e.prototype, "pfb_laser", void 0), a([R(cc.Prefab)], e.prototype, "pfb_shotgun", void 0), a([R(cc.Prefab)], e.prototype, "pfb_boom", void 0), a([R(cc.Prefab)], e.prototype, "pfb_tray", void 0), a([R(cc.Prefab)], e.prototype, "pfb_thruster", void 0), a([R(cc.Prefab)], e.prototype, "pfb_revThruster", void 0), a([R(cc.Prefab)], e.prototype, "pfb_harpoon", void 0), a([R(cc.Prefab)], e.prototype, "pfb_mine", void 0), a([R(cc.Node)], e.prototype, "node_carLeft", void 0), a([R(cc.Node)], e.prototype, "node_carRight", void 0), a([R(cc.Node)], e.prototype, "node_wheel0", void 0), a([R(cc.Node)], e.prototype, "node_wheel1", void 0), a([O], e);
}(cc.Component);

o["default"] = P;

cc._RF.pop();